package com.wlk.Result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private Integer code;
    private String message;
    private Object data;

    public static Result ok(){
       return new Result(200,"success",null);
    }
    public static Result ok(Object data){
        return new Result(200,"success",data);
    }
    public static Result error(){
        return new Result(500,"error",null);
    }
    public static Result error(String message){
        return new Result(500,message,null);
    }
    public static Result fail(){
        return new Result(400,"fail",null);
    }
    public static Result fail(String message){
        return new Result(400,message,null);
    }


}
